using System;
using System.Collections.Generic;
using System.Text;
using MacomberMap.Common.Types;
using System.Data.Common;
using System.Xml;
using MacomberMap.Common.Database_Interface.CIM.Components;
using MacomberMap.Common.Components;

namespace MacomberMap.Loader.Export.OneLines
{
    /// <summary>
    /// This class holds information on a one-line in MM
    /// </summary>
    public class MM_Database_OneLine : MM_Serializable
    {
        #region Variable declarations
        /// <summary>The ID of our one-line</summary>
        public int ID;

        /// <summary>The names that this one-line could refer to</summary>
        public String[] Names;

        /// <summary>The models for which this item is identified</summary>
        public int[] Models;

        /// <summary>The XML configuration for the one-line</summary>
        public XmlDocument Document;

        /// <summary>The TEID of the one-line</summary>
        public UInt64 TEID;

        /// <summary>The rdf:ID of the one-line</summary>
        public MM_rdfID rdfID;

        /// <summary>
        /// The one-line enumerator type
        /// </summary>
        public enum OneLineTypeEnum
        {
            /// <summary>This one-line is of a substation</summary>
            Substation = 0,

            /// <summary>This one-line is a breaker-to-breaker</summary>
            BreakerToBreaker = 1
        }


        /// <summary>The type of one-line this is</summary>
        public OneLineTypeEnum OneLineType;
        #endregion

        /// <summary>
        /// Initialize a new one-line
        /// </summary>
        /// <param name="dRd"></param>         
        public MM_Database_OneLine(DbDataReader dRd)
            : base(dRd)
        {                        
        }

        /// <summary>
        /// Report the one-line's name(s)
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return String.Join("/", Names);
        }
    }
}
    